//
//  RMMPayFailureView.m
//  Romomo
//
//  Created by puman on 2017/2/15.
//  Copyright © 2017年 mazegong. All rights reserved.
//

#import "RMMPayFailureView.h"

@implementation RMMPayFailureView
{
    UILabel *_label;
}
- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        _label = [[UILabel alloc] initWithFrame:CGRectMake(0, 50, self.width, kMaric)];
        _label.textColor = COLORFROMCODE(0x2C2C2C, 1);
        _label.font = kFont(16);
        _label.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_label];
        NSArray *titleArray = @[@"返回首页",@"继续支付"];
        for (int i = 0; i < 2; i++) {
            UIButton *button = [UIButton buttonWithType:(UIButtonTypeCustom)];
            button.frame = CGRectMake(15 + (self.width - 280 - 30 + 140) * i, _label.bottom + kMaric, 140, 40);
            button.backgroundColor = kBasicColor;
            button.titleLabel.font = kFont(15);
            [button setTitle:titleArray[i] forState:(UIControlStateNormal)];
            [self addSubview:button];
            switch (i) {
                case 0:
                    _backHomeBut = button;
                    break;
                case 1:
                    _goonPayBut = button;
                    break;

                default:
                    break;
            }
        }
    }
    return self;
}
- (void)setTitleName:(NSString *)titleName{
    _label.text = titleName;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
